﻿using System;
using System.Runtime.Serialization;
using NCMIS.ObjectModel.MetaData;

namespace NCMIS.Produce
{
    /// <summary>
    /// Represents the set of information available on a CMIS repository, including the optional capabilities and access control information.
    /// </summary>
    [DataContract(Name = "repositoryInfo", Namespace = CmisNs.Cmis)]
    public class RepositoryInfo
    {
        /// <summary>
        /// The id of the repository.
        /// </summary>
        [DataMember(Name = "repositoryId", Order = 1)]
        public string RepositoryId
        {
            get;
            set;
        }

        /// <summary>
        /// A display name for the repository.
        /// </summary>
        [DataMember(Name = "repositoryName", Order = 2)]
        public string RepositoryName
        {
            get;
            set;
        }

        /// <summary>
        /// A description of the Repository.
        /// </summary>
        [DataMember(Name = "repositoryDescription", Order = 3)]
        public string RepositoryDescription
        {
            get;
            set;
        }

        /// <summary>
        /// A display name for the vendor of the repository’s underlying application.
        /// </summary>
        [DataMember(Name = "vendorName", Order = 4)]
        public string VendorName
        {
            get;
            set;
        }

        /// <summary>
        /// A display name for the repository’s underlying application.
        /// </summary>
        [DataMember(Name = "productName", Order = 5)]
        public string ProductName
        {
            get;
            set;
        }

        /// <summary>
        /// A display name for the version number of the repository’s underlying application.
        /// </summary>
        [DataMember(Name = "productVersion", Order = 6)]
        public string ProductVersion
        {
            get;
            set;
        }

        /// <summary>
        /// The id of the root folder.
        /// </summary>
        [DataMember(Name = "rootFolderId", Order = 7)]
        public string RootFolderId
        {
            get;
            set;
        }

        /// <summary>
        /// The change log token corresponding to the most recent change event for any object in the repository.
        /// </summary>
        [DataMember(Name = "latestChangeLogToken", Order = 8)]
        public string LatestChangeLogToken
        {
            get;
            set;
        }

        /// <summary>
        /// The set of values for the repository-optional capabilities.
        /// </summary>
        [DataMember(Name = "capabilities", Order = 9)]
        public RepositoryCapabilities Capabilities
        {
            get;
            set;
        }

        /// <summary>
        /// The set of values for the repository ACL capabilities.
        /// </summary>
        [DataMember(Name="aclCapability", EmitDefaultValue = false, Order = 10)]
        public AclCapability AclCapability
        {
            get;
            set;
        }

        /// <summary>
        /// A decimal that indicates what version of the CMIS specification this repository supports.
        /// </summary>
        [DataMember(Name = "cmisVersionSupported", Order = 11)]
        public decimal CmisVersionSupported
        {
            get;
            set;
        }

        /// <summary>
        /// A optional repository-specific URI pointing to the repository's web interface.
        /// </summary>
        [DataMember(Name = "thinClientURI", EmitDefaultValue = false)]
        public string ThinClientUri
        {
            get;
            set;
        }

        /// <summary>
        /// Indicates whether or not the repository’s change log can return all changes ever made to any object in the repository
        /// or only changes made after a particular point in time. Applicable when the repository’s optional capability
        /// capabilityChanges is not none.
        /// </summary>
        [DataMember(Name = "changesIncomplete", EmitDefaultValue = false, Order = 12)]
        public bool ChangesIncomplete
        {
            get;
            set;
        }

        /// <summary>
        /// Indicates whether changes are available for base types in the repository.
        /// </summary>
        [DataMember(Name = "changesOnType", EmitDefaultValue = false, Order = 13)]
        public BaseObjectTypeId[] ChangesOnType
        {
            get;
            set;
        }

        /// <summary>
        /// If set, this field holds the principal who is used for anonymous access.  This principal can then be passed to
        /// the ACL services to specify what permissions anonymous users should have.
        /// </summary>
        [DataMember(Name = "principalAnonymous", EmitDefaultValue = false, Order = 14)]
        public string PrincipalAnonymous
        {
            get;
            set;
        }

        /// <summary>
        /// If set, this field holds the principal who is used to indicate any authenticated user. This principal can then
        /// be passed to the ACL services to specify what permissions any authenticated user should have.
        /// </summary>
        [DataMember(Name = "principalAnyone", EmitDefaultValue = false, Order = 15)]
        public string PrincipalAnyone
        {
            get;
            set;
        }
    }
}
